import React, { Component, PureComponent } from "react";
// class Demo extends PureComponent{
//   render(){
//     return <h1>Demo组件{this.props.msg}</h1>
//   }
//   componentDidUpdate(){
//     console.log("Demo组件更新好了");
//   }
// }
// function Demo(props){
//   console.log("Demo 组件渲染了");
//   return <h1>Demo组件{props.msg}</h1>
// }
let Gaoxingneng = React.memo(function Moxing(props) {
  console.log("模型组价你渲染");
  return <h3>模型组你渲染{props.msg}</h3>;
});
export default class App extends Component {
  state = {
    msg: "昊辰",
  };
  dianji = () => {
    this.setState({
      //   msg: "昊辰",
      msg: "杨洋",
    });
  };
  render() {
    return (
      <div>
        <Gaoxingneng msg={this.state.msg}></Gaoxingneng>
        <button onClick={this.dianji}>变化</button>
      </div>
    );
  }
}
